package co.yixiang.modules.rabbitMq.controller;

import co.yixiang.modules.rabbitMq.MqUtils;
import co.yixiang.modules.rabbitMq.constant.QueueConstants;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.time.LocalDateTime;

//@RestController
//@RequestMapping("mqtest")
public class MqTestController {


//	@PostMapping(value = "/test")
	public void download() throws IOException {
		String data = LocalDateTime.now().toString();
		System.out.println("[string] send msg:" + data);
		MqUtils.convertAndSend(QueueConstants.TEST_QUEUE, data);
	}
}
